/*
 * File:   NullPointerExceptionUnitTest.cpp
 * Author: Guilherme Monteiro
 *
 */

#include "NullImageExceptionTest.h"

CPPUNIT_TEST_SUITE_REGISTRATION(NullImageExceptionTest);

NullImageExceptionTest::NullImageExceptionTest() {
}

NullImageExceptionTest::~NullImageExceptionTest() {
}

void NullImageExceptionTest::setUp() {
}

void NullImageExceptionTest::tearDown() {
}

void NullImageExceptionTest::testWhat() {
    string path = "xx";
    NullImageException* nex = new NullImageException(path);
    const char* result = nex->what();
    
    string message = "ERROR ==> Image " + path + " can't be loaded. Change the image path or the directory of execution";
    
    if (strcmp(result, message.c_str()) != 0) {
        CPPUNIT_ASSERT(false);
    }
}

